<template>
    <div>
        <div style="margin-top:-50px;margin-bottom:-30px;">
        <el-link type="primary" @click="comName='shopInfo'">店铺信息</el-link>
        <el-link type="primary" style="margin-left:20px;" @click="notify">订单发货</el-link>
        <el-link type="primary" style="margin-left:20px;" @click="comName='myGoods'">我的商品</el-link>
        <el-link type="primary" style="margin-left:20px;" @click="comName='upload'">添加商品</el-link>
        </div>
        <transition mode="out-in">
            <component :is="comName"></component>
        </transition>
    </div>
</template>
<script>
import notify from '../views/notify.vue'
import shopInfo from '../views/shopInfo.vue'
import myGoods from '../views/myGoods.vue'
import upload from '../views/upLoad.vue'
import Vue from 'vue'
Vue.component('notify',notify);
Vue.component('shopInfo',shopInfo);
Vue.component('myGoods',myGoods);
Vue.component('upload',upload);
export default {
    data(){
        return{
            comName:'shopInfo'
        }
    },
    methods:{
        notify(){
            let market = {
                'marketname':this.$store.state.marketName
            }
            console.log(market);
            this.axios.post("/api/shopping/getOrder.php",market).then(res=>{
                this.$store.dispatch('setOrderdata',res.data);
                console.log(res.data);
            });
            this.comName='notify';
        }
    }
}
</script>
<style>
  .v-enter,
  .v-leave-to{
      opacity: 0;
      transform: translateX(150px);
  }
  .v-enter-active,
  .v-leave-active{
      transition: all 0.6s ease;
  }
</style>